#include "hello.h"
#include "world.h"
#include <pthread.h>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
// #include "json/json.h"
#include "test.h"
using namespace std;
typedef struct Student
{
    int age;
    char *name;
};

void *callback(void *arg)
{
    Student *sp = (Student *)arg;
    printf("子线程ID :%ld \n", pthread_self());
    sp->age = 23;
    sp->name = "coco";
    server_f();
    printf("age ZI = %d, name ZI = %s\n", sp->age, sp->name);
    pthread_exit(sp);
    return NULL;
}

int main()
{
    pthread_t ph;
    Student s1 = {0};
    int a = 10;
    pthread_create(&ph, NULL, callback, &s1);
    printf("主线程ID :%ld\n", pthread_self());
    void *phrsp;
    pthread_join(ph, &phrsp);
    printf("age = %d, name = %s\n", s1.age, s1.name);

    // Json::Value js;
    // js["type"] = 1;
    // js["types"] = "typestring";
    // std::cout<<js.toStyledString().c_str()<<endl;
    return 0;
}
